#include "ExRenderThread.h"
#include "ExMainHUD.h"
#include <time.h>
#include <QDebug>

ExRenderThread::ExRenderThread(QObject *parent)
	: QThread(parent)
{
	MainHUD = dynamic_cast<ExMainHUD*>(parent);

	IsStop = false;
}

ExRenderThread::~ExRenderThread()
{
}

void ExRenderThread::stop()
{
	IsStop = true;
}

void ExRenderThread::run()
{
	while (!IsStop)
	{
		clock_t StartTime = clock();
		emit RenderRun();
		clock_t UseTime = clock() - StartTime;

		if (UseTime < 15)
			QThread::msleep(15 - UseTime);
	}
}
